﻿<!--<SnippetHDT>-->
<Window x:Class="SDKSample.Window1"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  Title="HierarchicalDataTemplate Sample"
  xmlns:src="clr-namespace:SDKSample"
  xmlns:BreadcrumbLib="clr-namespace:BreadcrumbLib;assembly=BreadcrumbLib">
	<DockPanel>
		<DockPanel.Resources>
			<src:ListLeagueList x:Key="MyList"/>

			<HierarchicalDataTemplate DataType="{x:Type src:League}" ItemsSource="{Binding Path=Divisions}">
				<TextBlock Text="{Binding Path=Name}"/>
			</HierarchicalDataTemplate>

			<HierarchicalDataTemplate DataType="{x:Type src:Division}" ItemsSource = "{Binding Path=Teams}">
				<TextBlock Text="{Binding Path=Name}"/>
			</HierarchicalDataTemplate>

			<DataTemplate DataType="{x:Type src:Team}">
				<TextBlock Text="{Binding Path=Name}"/>
			</DataTemplate>
		</DockPanel.Resources>

		<Menu Name="menu1" DockPanel.Dock="Top" Margin="10,10,10,10">
			<MenuItem Header="My Soccer Leagues" ItemsSource="{Binding Source={StaticResource MyList}}" />
		</Menu>
		
		<StackPanel DockPanel.Dock="Top" Margin="10">
			<BreadcrumbLib:Breadcrumb x:Name="breadcrumb" Margin="10">
				<!--Root-->
				<BreadcrumbLib:BreadcrumbItem ItemsSource="{Binding Source={StaticResource MyList}}">
					<BreadcrumbLib:BreadcrumbItem.Header>
						<Image Source="Journal.png"/>
					</BreadcrumbLib:BreadcrumbItem.Header>
				</BreadcrumbLib:BreadcrumbItem>
				<!--end root-->
				<BreadcrumbLib:Breadcrumb.Buttons>
					<Button Width="24">
						<Image Source="vista refresh.png" Width="16" Height="16" Margin="3,0,0,0"/>
					</Button>
				</BreadcrumbLib:Breadcrumb.Buttons>
			</BreadcrumbLib:Breadcrumb>
			<StackPanel Orientation="Horizontal" Margin="10">
				<TextBlock Text="Selected item: "/>
				<TextBlock Text="{Binding ElementName=breadcrumb, Path=SelectedItem}"/>
			</StackPanel>
		</StackPanel>

		<TreeView>
			<TreeViewItem ItemsSource="{Binding Source={StaticResource MyList}}" Header="My Soccer Leagues" />
		</TreeView>

	</DockPanel>
</Window>
<!--</SnippetHDT>-->

